import axios from 'axios'

const xio = axios.create({
    baseURL: 'http://localhost:3000/',
    timeout: 3000
})

xio.interceptors.request.use(
    function (config) {
        config.headers['token'] = localStorage.getItem('token')
        return config
    },
    function (error) {
        return Promise.reject(error)
    }
)
xio.interceptors.response.use(
    function (response) {
        return response
    },
    function (error) {
        return Promise.reject(error)
    }
)
export default xio